<?php
use yii\widgets\ActiveForm;
use kartik\file\FileInput;
use yii\helpers\Html;
use yii\bootstrap\Modal;
use yii\helpers\Url;
use yii\helpers\ArrayHelper;
?>
<style type="text/css">
	.data-form label{
		color: white;
	}

	.data-form h1,h2,h3{
		color: white;
	}
</style>
<?php $form = ActiveForm::begin([
	'options' => ['enctype'=>'multipart/form-data'],
	]); ?>
	<div class="row data-form" style="width: 80%; margin: 0px auto; padding-top: 20px; padding-bottom: 20px;background: gray;">
		<h3 style="text-align:center;"><?=$pageTitle?></h3>
		<hr/>
		<div class="col-lg-6">
			<?=$form->field($product, 'name')->textInput()?>
			<?=$form->field($product, 'stime')->widget(kartik\date\DatePicker::className(),[ 
				'value' => date('d-M-Y', strtotime('+2 days')),
				'options' => ['placeholder' => 'Select issue date ...'],
				'pluginOptions' => [
					'format' => 'yyyy-mm-dd',
					'todayHighlight' => true
				]
			])?>
			<?=$form->field($product, 'etime')->widget(kartik\date\DatePicker::className(),[ 
				'value' => date('d-M-Y', strtotime('+2 days')),
				'options' => ['placeholder' => 'Select issue date ...'],
				'pluginOptions' => [
					'format' => 'yyyy-mm-dd',
					'todayHighlight' => true
				]
			])?>
			<?=$form->field($product, 'status')->dropDownList(ArrayHelper::map($slists, 'id', 'name'),['prompt'=>'选择状态'])?>	
		</div>
		<div class="col-lg-6">
            <?=$form->field($product, 'image_id')->widget(\noam148\imagemanager\components\ImageManagerInputWidget::className(), [
                'aspectRatio' => (18/9), //set the aspect ratio
                'showPreview' => true, //false to hide the preview
                'showDeletePickedImageConfirm' => false, //on true show warning before detach image
            ]);?>
		</div>
		<div class="col-lg-12">
			<?= $form->field($product, 'description')->widget(\yii\redactor\widgets\Redactor::className(), [ 
			    'clientOptions' => [ 
			        'imageManagerJson' => ['/redactor/upload/image-json'], 
			        'imageUpload' => ['/redactor/upload/image'], 
			        'fileUpload' => ['/redactor/upload/file'], 
			        'lang' => 'zh_cn', 
			        'plugins' => ['clips', 'fontcolor','imagemanager'],
			        'minHeight' => '300px',
			    ],
			]) ?>
			<?=Html::submitButton('提交', ['class'=>'btn btn-primary btn-block','name' =>'submit-button'])?>
		</div>
	</div>
<?php ActiveForm::end(); ?>
